package com.dlm.service;

import com.dlm.dao.Order;
import com.dlm.dao.WorkTime;
import com.jfinal.plugin.activerecord.Page;

import java.util.List;

/**
 * Created by chongsong on 15/2/1.
 * <mailto>chong.song@autonavi.com</mailto>
 * 订单service类
 */
public interface IOrderService {
    /**
     * 添加订单
     * @param order 订单对象
     * @return  成功:true  失败:falsel
     * @throws Exception
     */
    public boolean add(Order order) throws Exception;

    /**
     * 根据id删除订单
     * @param id    订单id
     * @return  成功:true  失败:falsel
     * @throws Exception
     */
    public boolean delete(long id) throws Exception;

    /**
     * 更新订单对象
     * @param order 订单对象
     * @return  成功:true  失败:falsel
     * @throws Exception
     */
    public boolean update(Order order) throws Exception;

    /**
     * 取消订单
     * @param orderId 订单id
     * @return
     * @throws Exception
     */
    public void cancel(long orderId) throws Exception;

    /**
     * 根据订单id查询
     * @param id    订单id
     * @return  返回订单对象
     * @throws Exception
     */
    public Order findById(long id) throws Exception;

    /**
     * 分页查询
     * @return 订单集合
     * @throws Exception
     */
    public Page<Order> findByPage(String userId,int pn, int ps) throws Exception;

    /**
     * 根据设计师id查询工作时间
     * @param techId    店面id
     * @param date  时间  格式: 2015/3/13
     * @return  返回结果
     */
    public List<Order> findWT(long techId,String date);

    public List<WorkTime> findAllWT();

    public void sendOrderSMS(long orderId);

    public void sendOrderCancelSMS(long orderId);
}
